package cn.wolfcode.plus.enums;

import lombok.Getter;

/**
 * Author wyy
 * Date 2021/1/17 15:58
 **/
@Getter
public enum AnnouncementEnum {
    GENERAL("普通",0),
    IMPORTANCE("重要",1),
    URGENCY("紧急",2);

    private final String name;
    private final Integer value;

    AnnouncementEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public static String findStatusName(Integer level) {
        AnnouncementEnum[] enums = AnnouncementEnum.values();
        for (AnnouncementEnum anEnum : enums) {
            if(level.equals(anEnum.getValue())){
                return anEnum.getName();
            }
        }
        return null;
    }
}
